import 'package:p_location/websocket/real_info.dart';

class LocationInfo {
  List<RealInfo> data;
  int code;

  LocationInfo({this.data, this.code});

  factory LocationInfo.fromJson(Map<String, dynamic> json) {
    return LocationInfo(
      data: json['data'] != null
          ? (json['data'] as List).map((i) => RealInfo.fromJson(i)).toList()
          : null,
      code: json['code'],
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
